<%@ page import="edu.sctu.Student" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/5/3
  Time: 17:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>


<%

    int x = 0;

    pageContext.setAttribute("x", x);

    pageContext.setAttribute("a", 10);

    request.setAttribute("b", 20);

    session.setAttribute("c", 30);

    application.setAttribute("d", 40);

    Student chen = new Student();
    chen.setId(1001);
    chen.setName("chengongsuo");

    pageContext.setAttribute("chens", chen);

%>
<p>x = ${x}</p>

<!-- pageContext -> request -> session -> application -->
<p>a = ${a}</p>

<p>${chens.id}</p>
<p>${chens["id"]}</p>
<p>${chens.username}</p>
<p>${chens["username"]}</p>


<hr/>

<p>${pageScope.a}</p>

<p>${requestScope.b}</p>

<p>${sessionScope.c}</p>

<p>${applicationScope.d}</p>

<hr/>

<p>${a}</p>
<p>${b}</p>
<p>${c}</p>
<p>${d}</p>

</body>
</html>
